package com.yuandian.management.socket;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * socket 初始化配置
 *
 * @author zhoutian
 * @date 2021/1/19 11:05
 */
@Configuration
public class SocketInitConfig {

    /**
     * 服务器端口
     */
    private static int SOCKET_PORT;
    /**
     * 服务器密码
     */
    private static String SOCKET_PASSWORD;

    @Value("${socket-config.common.socket.port:60020}")
    public void setSocketPort(int socketPort) {
     	SocketInitConfig.SOCKET_PORT = socketPort;
    }

    @Value("${socket-config.common.socket.password:yuandian}")
    public void setSocketPassword(String socketPassword) {
       SocketInitConfig.SOCKET_PASSWORD = socketPassword;
    }

    public static int getSocketPort() {
        return SocketInitConfig.SOCKET_PORT;
    }

    public static String getSocketPassword() {
        return SocketInitConfig.SOCKET_PASSWORD;
    }

}
